<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${ctx}/component/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<title>查询系统日志信息</title>
<%@ include file="/include/header.jsp"%>
</head>
<body>
	<div class="main_panel">
		<div class="ch_panel" id="queryDiv">
			<input type="hidden" data-qname="currentPage" value="1" />
			<table class="c_table m_t10">
				<tr>
					<td class="t_tit">操作人 :</td>
					<td width="271">
						<input type="text" data-qname="operationUsername" value="" class="input_txt" />
					</td>
					<td class="t_tit">操作动作 :</td>
					<td width="20%">
						<select data-qname="operationAction" style="width: 100px;">
							<option value="">--请选择--</option>
							<c:forEach items="${operActionMap}" var="var">
								<option value="${var.key }">${var.value}</option>
							</c:forEach>
						</select>
					</td>
					<td class="t_tit">日志类型 :</td>
					<td>
						<select id="logType" data-qname="logType" style="width: 100px;">
							<option value="">--请选择--</option>
							<c:forEach items="${logTypeMap}" var="var">
								<option value="${var.key }">${var.value}</option>
							</c:forEach>
						</select>
					</td>
				</tr>
				<tr>
					<td class="t_tit">操作时间:</td>
					<td>
						<input type="text" data-qname="beginOperationTime" class="input_txt" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" style="width: 120px" />
						/
						<input type="text" data-qname="endOperationTime" class="input_txt" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" class="input_txt" style="width: 120px" />
					</td>
					<td class="t_tit">IP地址:</td>
					<td>
						<input type="text" data-qname="ip" value="" class="input_txt" />
					</td>
					<td colspan="2" align="center">
						<input type="button" value="查询" id="searchBtn" class="c_btn" />
					</td>
				</tr>
			</table>
		</div>

		<div id="pro_2" class="pro_box ">
			<table id="tbwrap" class="table table-border table-bordered table-bg m_t10 hovaertable"></table>
			<div class="page eui-pager-custom" id="j_pager"></div>
		</div>
	</div>

	<script type="text/html" id="tb_template">
	    <thead>
			<tr>
				<th >操作人</th>
				<th>操作内容</th>
				<th>请求地址</th>
				<th>IP地址</th>
				<th width="60">日志类型</th>
				<th width="121">操作时间</th>
				<th width="50">操作</th>
			</tr>
		</thead>
		<tbody data-type="body" id="queryTable">
    		<!if(list.length>0) { !>
        		<!for(var i=0,len=list.length;i<len;i++){
            		var item = list[i],classItem = (i%2!=0)?"odd td_odd":"even";
          		!>
		    	<tr class="gradeA <!=classItem!>">
			    	<td><!=item["operationUsername"]!></td>
					<td align="left"><!=item["opeContent"]!></td>
			    	<td align="left"><!=item["requestUrl"]!></td>
			    	<td><!=item["ip"]!></td>
  					<td><!=item["operationTypeName"]!></td>
			    	<td><!=item["operationTime"]!></td>
			    	<td>
						<a title="详情" data-value="<!=item["logId"]!>" class="view" style="text-decoration: none;margin-right: 10px;">
							<i class="Hui-iconfont">&#xe665;</i>
						</a>
					</td>
		   		</tr>
        	<!}!>
    		<!}else{!>
				<tr>
		    		<td colspan="10"> 暂无数据</td>
				</tr>
    		<!}!>
 		</tbody>
	</script>


	<script type="text/javascript">
		var sysLogDialog;
		$(function () {
			// 2、详细
			$("#tbwrap").delegate(".view", "click", function() {
				//获取主键
				var logId = $(this).data("value");
				parent.member_add("查看系统操作日志信息", "${ctx}/sysLog/view?logId="+logId,700,350);
			});
			// 5、查询
			$("#searchBtn").click(function () {
				search();
			});
		});
	</script>

	<script type="text/javascript">
		$(function () {
			search();
		});

		function search () {
			// 这里放包含查询条件的DIV
			var paramData = easyUtils.getQueryDivDefault("queryDiv");

			seajs.use([ "component/table" ], function (uiTable) {
				var param = {
					url : "${ctx}/sysLog/ajaxPage", data : paramData
				};
				easyUtils.getData(param, function (result) {
					easyUtils.buildTable(result, param, uiTable);
					if (result.dataList.length > 0) {
						easyUtils.fullRows("queryTable", 7);
					}
				});
			});
		}
	</script>

</body>
</html>
